home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / HOOKUP.MPS < prev    next >
Text File  |  1995-10-09  |  3KB  |  100 lines

  1. # HookUp Login Script - PPP
  2.  
  3. # Always place a comment as the first line with the name of the provider
  4. # and the type of connection. We will attempt to display this in the
  5. # script file requestor to aid the user in selecting an appropriate
  6. # script since the filename may not be sufficient.
  7.  
  8. #define the variables we will need
  9.  
  10. STRING username
  11. STRING password
  12. STRING framing
  13. STRING IPAddress
  14.  
  15. # uncomment for debugging
  16.  
  17. # TRACE ON
  18.  
  19. # reset maximum login timeout. We put this here in case it took an
  20. # unusually long amount of time to get the initial connection. Its
  21. # probably too long but its better to be safe then sorry.
  22.  
  23. SetTimeout 90
  24.  
  25. # Get username from access method
  26.  
  27. # NOTE: Some systems do not require a username.
  28.  
  29. # This step will not be necessary in those cases.
  30.  
  31. CfgGetValue "Username" username
  32. # if the Username field is empty, prompt the user for it.
  33. IF result = 0 THEN
  34.     GetInput "Enter your user name" username
  35.     IF result = 0 THEN
  36.         PRINT "Warning, no username entered"
  37.     ELSE
  38.         PRINT "Username set to ["; username; "]"
  39.     ENDIF
  40. ENDIF
  41.  
  42. # get password from access method
  43.  
  44. # NOTE: Some systems do not require a password.
  45.  
  46. # This step will not be necessary in those cases.
  47.  
  48. CfgGetValue "Password" password
  49. # if the Password field is empty, prompt the user for it.
  50. IF result = 0 THEN
  51.     GetPassword "Enter your password" password
  52.     IF result = 0 THEN
  53.         PRINT "Warning, no password entered"
  54.     ELSE
  55.     # NOTE: Don't print password.
  56.         PRINT "Password set."
  57.     ENDIF
  58. ENDIF
  59.  
  60. # get framing layer (MPPPP, MPSLIP)
  61. CfgGetValue "Framing" framing
  62.  
  63. # abort with an error if we can't read the Framing setting
  64. IF result = 0 THEN
  65.     ABORT "Can't read 'Framing' setting from qdeck.ini"
  66. ENDIF
  67.  
  68. CommWaitFor "login:"         # wait for login prompt
  69.     CommSend username         # send user name
  70.     CommSend "%r"             # send carriage return
  71. CommWaitFor "Password:"     # wait for password prompt
  72.     CommSend password         # send password
  73.     CommSend "%r"             # send carriage return
  74.  
  75. # if SLIP, we need to get the IP address
  76. IF framing = "MPSLIP" THEN
  77.     CommWaitFor "choice:"
  78.     Delay 2
  79.     CommSend "2%r"
  80.     PRINT "SLIP Selected"
  81. ENDIF # END of SLIP logic
  82.  
  83. # if PPP, no need and go
  84. IF framing = "MPPPP" THEN
  85.     CommWaitFor "choice:"
  86.     Delay 2
  87.     CommSend "3%r"
  88.     PRINT "PPP Selected"
  89. ENDIF
  90.  
  91. CommWaitFor "dress:"
  92.     CommReadIPAddr IPAddress
  93.     IF result < 7 THEN                     # IP Address length test
  94.         ABORT "Missing or invalid IP Address."
  95.     ENDIF
  96. CfgSetValue "IPAddress" ipaddress
  97. PRINT "IP Address set to:"; ipaddress
  98.  
  99. END                         # indicate success IF we got this far
  100.